home *** CD-ROM | disk | FTP | other *** search
/ Gekkan Dennou Club 145 / Gekkan Dennou Club - 2000.6 Vol. 145 (Japan).7z / Gekkan Dennou Club - 2000.6 Vol. 145 (Japan) (Track 1).bin / tools / sharp / sxwork2.lzh / サンプル基礎編 / イベント描画 / EVENTWR.H < prev    next >
Text File  |  1994-03-10  |  3KB  |  86 lines

  1. /******************************************************************************
  2.  *    eventwr.h:    eventwr.c用ヘッダファイル
  3.  ******************************************************************************
  4.  *    Workroom SX-68K Sample Program Copyright 1994 SHARP
  5.  *
  6.  *    定数定義
  7.  */
  8. /* ウィンドウタイトル */
  9. #define WINTITLE    ((_LASCII) "\x0eイベントの描画")
  10.  
  11. /* ウィンドウサイズ */
  12. #define WIN_H        300        /* ウィンドウの幅        */
  13. #define WIN_V        120        /* ウィンドウの高さ        */
  14.  
  15. /* タイトルの表示位置 */
  16. #define TTL1_X        18        /* ポインタ座標            */
  17. #define TTL1_Y        18
  18. #define TTL2_X        TTL1_X        /* マウス左ボタン        */
  19. #define TTL2_Y        (TTL1_Y + 18)
  20. #define TTL3_X        TTL1_X        /* マウス右ボタン        */
  21. #define TTL3_Y        (TTL2_Y + 18)
  22. #define TTL4_X        TTL1_X        /* キーボード            */
  23. #define TTL4_Y        (TTL3_Y + 18)
  24.  
  25. /* 文字列の表示位置 */
  26. #define STR1_X        (TTL1_X + 18 * 6) /* ポインタ座標X        */
  27. #define STR1_Y        TTL1_Y
  28. #define STR2_X        (STR1_X + 5 * 6) /* ポインタ座標Y        */
  29. #define STR2_Y        STR1_Y
  30. #define STR3_X        STR1_X        /* マウス左ボタン        */
  31. #define STR3_Y        TTL2_Y
  32. #define STR4_X        STR1_X        /* マウス右ボタン        */
  33. #define STR4_Y        TTL3_Y
  34. #define STR5_X        STR1_X        /* ASCIIコード(キーボード)    */
  35. #define STR5_Y        TTL4_Y
  36. #define STR6_X        (STR5_X + 4 * 6) /* シフトキービット(キーボード)*/
  37. #define STR6_Y        STR5_Y
  38.  
  39. /* イベントマスク */
  40. #define EVENTMASK    (EM_IDLE | EM_MSLDOWN | EM_MSLUP | EM_MSRDOWN | EM_MSRUP | EM_UPDATE | EM_ACTIVATE | EM_SYSTEM1 | EM_SYSTEM2)
  41.  
  42. enum strKind {                /* 表示文字列の種類        */
  43.     ALL        = -1,        /* 全部                */
  44.     MSL,                /* 0, マウス左ボタン        */
  45.     MSR,                /* 1, マウス右ボタン        */
  46.     PTX,                /* 2, ポインタ座標X        */
  47.     PTY,                /* 3,      〃     Y        */
  48.     ASC,                /* 4, ASCIIコード(キーボード)    */
  49.     SFT,                /* 5, シフトキービット( 〃  )    */
  50. };
  51. /*
  52.  *    構造体宣言
  53.  */
  54. typedef struct ComVal {            /* 共通変数            */
  55.     Window *windowPtr;        /* ウィンドウポインタ        */
  56.     BOOLEAN activeFlag;        /* アクティブフラグ        */
  57.     TsEvent event;            /* イベントレコード        */
  58.     int eventMask;            /* イベントマスク        */
  59.     int errorCode;            /* エラーコード            */
  60.     BOOLEAN endFlag;        /* 終了フラグ            */
  61.     LPoint lastLpt;            /* 前のポインタ座標        */
  62.     unsigned long lastTime[2];    /* マウスのボタンが最後に押された時間 */
  63.     char dispStr[6][16];        /* 表示文字列            */
  64. } ComVal;
  65. /*
  66.  *    関数プロトタイプ
  67.  */
  68. /* eventwr.c */
  69. BOOLEAN init(ComVal *);
  70. BOOLEAN createWindow(ComVal *);
  71. void idleEvent(ComVal *);
  72. void msLDownEvent(ComVal *);
  73. void msLUpEvent(ComVal *);
  74. void msRDownEvent(ComVal *);
  75. void msRUpEvent(ComVal *);
  76. void keyDownEvent(ComVal *);
  77. void updateEvent(ComVal *);
  78. void drawGraph(ComVal *);
  79. void activateEvent(ComVal *);
  80. void systemEvent(ComVal *);
  81. void showErrDialog(ComVal *);
  82. void endProc(int, ComVal *);
  83. void drawMSDown(ComVal *, int);
  84. void drawMSUp(ComVal *, int);
  85. void drawDispStr(ComVal *, int);
  86.